<?php 
if (isset($_REQUEST['empty'])) {
	$cid = $_SESSION['cid'];
	$cartInfo = $soap->call ($session_id, 'cart.info', $cid);
	// echo print_r($cartInfo);
	$items = $cartInfo['items'];
	$num_items = sizeof($items);
	for ($l = 0; $l < $num_items; $l++) {
		$temp_id = $items[$l]['product_id'];
		$arrProducts = array(
			array(
				"product_id" => $temp_id
			),
		);
		// remove all items in cart
		$resultCartProductRemove = $soap->call($session_id, "cart_product.remove", array($cid, $arrProducts));
	}
}
?>